package com.itbaizhan.controller;

import com.itbaizhan.domain.User;
import com.itbaizhan.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.TimeUnit;

@RestController
public class UserController {

    @Autowired
    private IUserService iUserService;

    /**
     * 查询所有学生
     * @return
     */
    @GetMapping("/findByAll")
    public List<User> findByAll(){
        try {
            Thread.sleep(6000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return iUserService.findByAll();
    }

}
